<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>seven网上商城</title>
<link href="${pageContext.request.contextPath}/css/common.css" rel="stylesheet" type="text/css"/>
<link href="${pageContext.request.contextPath}/css/product.css" rel="stylesheet" type="text/css"/>
  <script type="text/javascript">
       //传递当前页和cid
       function gotopage(page,cid){
    	   window.location.href="${pageContext.request.contextPath}/product_findByCid?page="+page+"&cid="+cid+"";
       }
  </script>
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/tit.ico" type="image/x-icon" />  
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jsized.snow.min.js"></script>
<script>
    createSnow('', 60);
</script>
</head>
<body>
<div class="container header">
	<div class="span5">
		<div class="logo">
			<a href="http://localhost:8080/mango/">
				<img src="${pageContext.request.contextPath}/image/r___________renleipic_01/logo2.gif" alt="seven商城"/>
			</a>
		</div>
	</div>
	<div class="span9">
<div class="headerAd">
			<img src="${pageContext.request.contextPath}/image/header.jpg" width="320" height="50" alt="正品保障" title="正品保障"/>
</div>	</div>
	<%@ include file="menu.jsp" %>
	
</div>	
<div class="container productList">
		<div class="span6">
			<div class="hotProductCategory">
			    <c:forEach var="c" items="${clist}">
						<dl> 
							<dt>
								<a href="${pageContext.request.contextPath}/findByCid?cid=${c.cid}&page=1">${c.cname}</a>
							</dt>
						         <c:forEach var="cs" items="${c.categorySecondList}">
									<dd>
										<a href="${pageContext.request.contextPath}/findByCsid?csid=1&page=1">${cs.csname}</a>
									</dd>
								</c:forEach>
						</dl>
				</c:forEach>
			</div>
		</div>
		<div class="span18 last">
		<%--
			
			<form id="productForm" action="${pageContext.request.contextPath}/image/蔬菜 - Powered By Mango Team.htm" method="get">
				<input type="hidden" id="brandId" name="brandId" value=""/>
				<input type="hidden" id="promotionId" name="promotionId" value=""/>
				<input type="hidden" id="orderType" name="orderType" value=""/>
				<input type="hidden" id="pageNumber" name="pageNumber" value="1"/>
				<input type="hidden" id="pageSize" name="pageSize" value="20"/>
			</form>		
				--%>
				<div id="result" class="result table clearfix">
						<ul>
						   <s:iterator value="list">
						           <li>
										<a href="${pageContext.request.contextPath}/product_findByPid?pid=${pid}">
											<img src="${pageContext.request.contextPath}/${image}" width="170" height="170"  style="display:inline-block;"/>
											<span class="pname">
											    ${pname}
											</span>
											 
											<span class="price" style='color:#ff3300;'>
												商城价： ￥${shop_price}
											</span>
											 
										</a>
									</li>
							</s:iterator>	
						</ul>
				</div>
				
	<%--显示分页 =====================================================================--%>			
	
	<div class="pagination">
	      <span style="color:#666;">第${page}页/共${pageCount}页</span>
	       <s:if test="page != 1">
		        <%--跳转到首页 --%>
				<a href="javascript:gotopage(1,${cid})" class="firstPage">&nbsp;</a>
				
				<%--上一页 --%>
				<a href="javascript:gotopage(${page}-1,${cid})" class="previousPage">&nbsp;</a>
		   </s:if>	  
			  <s:iterator var="num" begin="%{beginIndex}" end="%{endIndex}">
				<s:if test="#num == page">
				   <span class="currentPage">${num}</span>
				</s:if>
				<s:else>
				   <a href="javascript:gotopage(${num},${cid})">${num}</a>
				</s:else>
			  </s:iterator>
           <s:if test="page != pageCount">
			<%--下一页 --%>
			<a href="javascript:gotopage(${page}+1,${cid})" class="nextPage">&nbsp;</a>
			
			<%--跳转到尾页 --%>  
			<a href="javascript:gotopage(${pageCount},${cid})"class="lastPage">&nbsp;</a>
	      </s:if>
	  </div>
	
			
		</div>
	</div>
	<%--尾部 --%>
	<%@ include file="bottom.jsp" %>
</body>
</html>
